﻿import FrameEditor;
import LuminicBox.Log.*;
import org.aswing.geom.Rectangle;
import org.aswing.plaf.custom.css.CSSParser;
import org.aswing.plaf.custom.CustomLookAndFeel;
import org.aswing.UIManager;
import TextField.StyleSheet;

class LAFEditor
{
	public static var cssText:String;
	
	public static function main(){
		cssText = "button,radio-button{\n\tfont:courier;\n\tfont-size:10;\n\tforeground-color:0x065410;\n}";
		init();
	}
	
	public static function init(){
		_root.clear();
		var laf:CustomLookAndFeel = new CustomLookAndFeel();
		var style:StyleSheet = new StyleSheet();
		style.parseCSS(cssText);
		laf.setCSSStyle(style);
		UIManager.setLookAndFeel(laf);			
		var editor:FrameEditor = new FrameEditor();
		////
		//CSSParser.parseDocument(cssText);
		//editor.setLog(ParserLog.getInstance().logMessage)
		////
		editor.setEditorCSS(cssText)
		editor.setLocation (2, 2);		
		editor.setSize (796, 596);
		editor.setDragable(false);
		editor.setResizable(false);
		editor.setClosable(false)
		editor.show ();
	}
	
	public static var logger:Logger;
	
	public static function trace(msg:String){
		if(logger == null){
			logger = new Logger();
			logger.addPublisher(new ConsolePublisher());
		}
		logger.log(msg)
	}
}
